<?php
$backend=dirname(dirname(__FILE__));
$frontend=dirname($backend);
Yii::setPathOfAlias('backend', $backend);
$frontendArray=require($frontend.'/config/main.php');
$backendArray=array(
    'name'=>'WWPeng Blog后台管理系统',
    'basePath' => $frontend,
    'controllerPath' => $backend.'/controllers',
    //'viewPath' => $backend.'/views',
    'runtimePath' => $backend.'/runtime',
	'theme' => 'wwpblog_admin-v1.0',
	'defaultController'=>'WwpblogAdmin',

    // autoloading model and component classes
    'import'=>array(
        'application.models.*',
		'backend.models.*',
        'backend.components.*', //这里的先后顺序一定要搞清
    ),
    'modules' => array(
        'login',
    ),
    'aliases' => array(
                'widgets' => 'application.widgets',
        ),
    'components'=>array(
                'user'=>array(
                       	'class'=>'AwebUser',
                        'allowAutoLogin'=>true,
    					'stateKeyPrefix'=>'adminData',
    					'loginUrl' => array('login'),
    					//'authTimeout'=>600     //设置超时时间
                ),
                'urlManager' => array(
                	'showScriptName' => true,
                    'urlSuffix'=>NULL,   //设置后缀
              	 ),
              	 'errorHandler'=>array(
           			 'errorAction'=>'wwpblogadmin/error',
        		 ),
    ),
    'params'=>array(
		// this is used in contact page
		'adminEmail'=>'591826944@qq.com',
    	'CookiesTime'=>3600*24*14, //设置自动登录时间   默认：两周
        'metaDKT'=>'Blog 后台~By : harry.wang'   //设置MetaDescription 、 MetaKeywords、pageTitle 的结尾标示，所有页面的MetaDescription 、 MetaKeywords、pageTitle 都以这个结尾，加入作者信息等
	),
    // main is the default layout
    //'layout'=>'main',
    // alternate layoutPath
    //'layoutPath'=>dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'layouts'.DIRECTORY_SEPARATOR,
);
if(!function_exists('w3_array_union_recursive'))
{
    /**
     * This function does similar work to $array1+$array2,
     * except that this union is applied recursively.
     * @param array $array1 - more important array
     * @param array $array2 - values of this array get overwritten
     * @return array
     */
    function w3_array_union_recursive($array1,$array2)
    {
        $retval=$array1+$array2;
        foreach($array1 as $key=>$value)
        {
            if(is_array($array1[$key]))
            {
            	if(isset($array2[$key]))
            	{
            		if(is_array($array2[$key]))
                		$retval[$key]=w3_array_union_recursive($array1[$key],$array2[$key]);
            	}
            	else
            		$retval[$key]=w3_array_union_recursive($array1[$key],array());
                		
            }
        }
        return $retval;
    }
}
return w3_array_union_recursive($backendArray,$frontendArray);